Skip to content

[CodeQuality] Skip init not empty array on InlineArrayReturnAssignRector#7276

Merged
samsonasik merged 2 commits intomainfrom
skip-init-not-empty
Sep 14, 2025
Merged

[CodeQuality] Skip init not empty array on InlineArrayReturnAssignRector#7276
samsonasik merged 2 commits intomainfrom
skip-init-not-empty

Conversation

@samsonasik
Copy link
Member

@samsonasik samsonasik commented Sep 14, 2025

Per #7271 (comment) , this is to skip init not empty array regression to avoid invalid change:

Failed on fixture file "skip_init_not_empty_array.php.inc"
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
 {
      public function some(SomeObject $someObject): array
      {
-        $message = [
-           'type' => 'type',
-            'id' => (string) $someObject->getId(),
-        ];
-        $message['link'] = $this->getSome($someObject);
-
-       return $message;
+         return ['link' => $this->getSome($someObject)];
      }

@samsonasik
Copy link
Member Author

Fixed 🎉 /cc @TomasVotruba

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@samsonasik samsonasik enabled auto-merge (squash) September 14, 2025 23:49
@samsonasik samsonasik merged commit 8d84db7 into main Sep 14, 2025
49 checks passed
@samsonasik samsonasik deleted the skip-init-not-empty branch September 14, 2025 23:50
@TomasVotruba
Copy link
Member

👍

@github-actions
Copy link
Contributor

This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants